package com.neoCalf.neoUser.feigns;

import com.neoCalf.neoCommon.entity.GroupInfo;
import com.neoCalf.neoCommon.model.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotEmpty;


@FeignClient(value = "groupService", path = "/api")
public interface GroupServiceFeign {
    /**
     * 获取用户的群组数量
     *
     * @param ownerId 用户ID
     * @return 用户的群组数量
     */
    @PostMapping("/group/myGroupCount")
    R<Long> myGroupCount(@RequestParam("ownerId") @NotEmpty String ownerId);

    /**
     * 获取群组信息
     *
     * @param groupId 群组ID
     * @return 群组信息
     */
    @GetMapping("/group/groupDetail")
    R<GroupInfo> getGroupInfo(@RequestParam("groupId") String groupId);
}
